﻿@using AFT.Parking.WebSite.Common
@model AFT.Parking.Foundation.IPagedList<AFT.Parking.WebSite.Models.ScanCodeLocationModel>

@{
    ViewBag.Title = "列表";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section Head{
    <script type="text/javascript">
        function Delete(id) {
            $.ajax({
                url: "/ScanCodeBinding/Delete",
                data:{ id: id },
                success: function (res) {
                    alert("删除成功");
                    $("#tr"+ id).remove();
                },
                error: function(res) {
                    alert("删除失败");
                }
            });
        }
    </script>
}
<div class="content-box">
    <!-- Start Content Box -->
    <div class="content-box-header">
        <h3>二维码列表</h3>
        <div class="clear"></div>
    </div>
    <form id="frm">
        <!-- End .content-box-header -->
        <div class="content-box-content">
            <div class="tab-content default-tab" id="tab1">
                <table>
                    <thead>
                        <tr>
                            <th>文字描述</th>
                            @*<th>路线</th>*@
                            <th>二维码Tiket</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tfoot>
                        <tr>
                            <td colspan="6">
                                <div class="pagination">
                                    @Html.Pager(Model)
                                </div>
                                <!-- End .pagination -->
                                <div class="clear"></div>
                            </td>
                        </tr>
                    </tfoot>
                    <tbody id="tBodyRows">
                        @foreach (var item in Model.Rows)
                        {
                            <tr id="@("tr"+item.Id)">
                                <td>@item.ShowTxt</td>
                                @*<td><img width="80" height="60" src="@(item.LineImg)" /></td>*@
                                <td><a href="https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=@item.ScanCodeTicket" target="_blank">@item.ScanCodeTicket</a></td>
                                <td>
                                    <a href="@Url.Action("Edit", new { locationId = item.LocationId,id = item.Id })" title="Edit">编辑</a>
                                    <a href="@Url.Action("AddLinePoint", new { MallLocationId = item.LocationId, ScanCodeAndLocationId = item.Id })" title="Edit">添加节点</a>
                                    <a href="#" title="Delete" onclick="Delete('@item.Id')">删除</a>
                                    <a href="@Url.Action("CheckLocations", new { locationId = item.LocationId, id = item.Id })" target="_blank">验证线路</a>
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
            </div>
            <!-- End #tab1 -->
        </div>
        <!-- End .content-box-content -->
    </form>
</div>